﻿<Application x:Class="VRacer.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:common="clr-namespace:VRacer;assembly=VRacer"
    StartupUri="Controls/MainWindow.xaml">
    <Application.Resources>

        <Style x:Key="PropertiesBorder" TargetType="Border">
            <Setter Property="BorderThickness" Value="2" />
            <Setter Property="Padding" Value="15" />
            <Setter Property="Margin" Value="10" />
            <Setter Property="MaxWidth" Value="700" />
            <Setter Property="Background">
                <Setter.Value>
                    <LinearGradientBrush Opacity="0.4" StartPoint="0.3,0" EndPoint="0,0.7">
                        <GradientStop Color="#aaaadd" Offset="0" />
                        <GradientStop Color="#ccddff" Offset="0.3" />
                        <GradientStop Color="#ddddff" Offset="0.6" />
                        <GradientStop Color="#ccccee" Offset="1" />
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
            <Setter Property="BorderBrush">
                <Setter.Value>
                    <LinearGradientBrush Opacity="0.2" StartPoint="0,0" EndPoint="0,0.7">
                        <GradientStop Color="#223322" Offset="0" />
                        <GradientStop Color="#000000" Offset="0.6" />
                        <GradientStop Color="#223322" Offset="1" />
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
        </Style>
        
        <DataTemplate DataType="{x:Type common:Track}">
            <Grid HorizontalAlignment="Stretch">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="60" />
                    <ColumnDefinition Width="60" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>

                
                <Image Grid.Column="0" Margin="5" Source="{Binding Mask}" />
                <Image Grid.Column="1" Margin="5" Source="{Binding Background}" />
                
                <StackPanel Grid.Column="2">
                    <TextBlock FontWeight="Bold" Grid.Column="1" Text="{Binding Title}" />
                    <TextBlock>
                        <TextBlock.Text>
                            <MultiBinding TargetNullValue="Unknown size" StringFormat="{}{0} x {1}">
                                <Binding Path="Width" />
                                <Binding Path="Height" />
                            </MultiBinding>
                        </TextBlock.Text>
                    </TextBlock>
                    <TextBlock DataContext="{Binding Highscores[0]}">
                        <TextBlock.Text>
                            <MultiBinding FallbackValue="Never played" StringFormat="{}No. 1 is {1} with {0} moves">
                                <Binding Path="Result" />
                                <Binding Path="Player" />
                            </MultiBinding>
                        </TextBlock.Text>
                    </TextBlock>
                </StackPanel>
                

            </Grid>
        </DataTemplate>
    </Application.Resources>
</Application>
